<%--suppress ALL --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/3/29
  Time: 15:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<html>
<head>
    <title></title>
  <link rel="stylesheet" href="<c:url value="/resources/css/list.css"/> "/>
</head>
<style type="text/css">
.text{
  margin-top: 3%;
}
</style>

<body>
<h2 style="text-align: center" class="text">用户信息一览表</h2>
<div class="tb">

<table class="imagetable">
  <tr>
    <th>username</th>
    <th>password</th>
    <th>nickname</th>
    <th>email</th>
  <th>修改</th>
  <th>删除</th>
  </tr>


  <c:forEach items="${spinguserList}" var="vm">
  <tr>
    <td><a href="${vm.username}"> ${vm.username}</a></td>
    <td>${vm.password}</td>
    <td>${vm.nickname}</td>
    <td>${vm.email}</td>
    <td><a href="${vm.id}/update?id=${vm.id}"> 修改</a></td>
    <td><a href="${vm.id}/delete?id=${vm.id}" >删除</a></td>
  </tr>
  </c:forEach>




  <tr align="center" >
    <td colspan="5" align="center">
      <pg:pager
      url="/user/list"
      items="${pager.totalRecord}"
      maxIndexPages="10"
      maxPageItems="${pager.pageSize}"
      export="currentPageNumber=pageNumber"><!-- export对pageNumber的重命名 -->
      <pg:first>
        <a href="${pageUrl }">首页</a>
      </pg:first>
      <pg:prev>
        <a href="${pageUrl }">前页</a>
      </pg:prev>
      <pg:pages>
        <c:choose>
          <c:when test="${currentPageNumber eq pageNumber }">
            <font color="red">${pageNumber }</font>
          </c:when>
          <c:otherwise>
            <a href="${pageUrl }">${pageNumber }</a>
          </c:otherwise>
        </c:choose>
      </pg:pages>
      <pg:next>
        <a href="${pageUrl }">后页</a>
      </pg:next>
      <pg:last>
        <a href="${pageUrl }">尾页</a>
      </pg:last>
      <br/>
      当前第${pager.pageIndex}页,共${pager.totalPage}页
      </pg:pager>
    </td>
    <td><a href="add" >添加用户</a><br>
      <a href="login">用户登录</a><br/>


      ------${loginUser.nickname}</td>

  </tr>

</table>
</div>

</body>

</html>






